#ifndef OPTIONS_H
#define OPTIONS_H

#include <QtCore/QObject>
#include <QtCore/QSettings>
#include "optionsdialog.h"

struct Settings {
    QString email;
    QString password;

    int checkTime;

    bool useProxy;
    QString proxyHost;
    int proxyPort;

    bool useProxyAuth;
    QString proxyUser;
    QString proxyPass;
};

class Options : public QObject
{
    Q_OBJECT
public:
    Options(QString configFile, QObject *parent = 0);
    ~Options();
    void updateValues(QString email, QString password);
    void load();
    void save();
    void showDialog();

    QSettings *config;
    OptionsDialog *dialog;
    Settings settings;
private:
    void updateGui();

signals:
    void optionsChanged();
public slots:
    void reloadFromGui();
};

#endif // OPTIONS_H
